<!DOCTYPE html>
<html lang="en">
<html xmlns:th="http://www.thymeleaf.org">
<script src="https://www.jq22.com/jquery/jquery-3.3.1.js"></script>


<body>
<div th:fragment="nav">

    <nav class="navbar navbar-default">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">马帅社区</span>
                </button>
                <a class="navbar-brand" href="/" style="margin-left: 25px;">
                    <img src="/img/taghead.jpg"style="width: 30px;height: 30px;">
                </a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <form class="navbar-form navbar-left" action="/">
                    <div class="form-group">
                        <!---f分页-->
                        <div class="dropdown">
                            <input id="dropdownMenu2" type="text" name="serachQuesions" class="lianhe_seach  dropdown-toggle form-control" placeholder="搜索问题"data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">

                            <ul class="dropdown-menu" aria-labelledby="dropdownMenu2" >
                                <div class="div_scroll" style="overflow-x: hidden;height: 270px;" id="apeendChoice">

                                </div>
                                <!-- <li><a href="#" onclick="getSlectValues(this)">Action</a></li>-->
                            </ul>
                        </div>
                    </div>
                    <button type="submit" class="btn btn-default">搜索</button>
                </form>
                <ul class="nav navbar-nav navbar-right" style="margin-right: 30px;">
                   <!-- <li style="margin-top: 11px;margin-right: 500px;">
                        <iframe scrolling="no" src="https://tianqiapi.com/api.php?style=ta&skin=pitaya" frameborder="0" width="400" height="24" allowtransparency="true"></iframe>
                    </li>-->
                    <li  style="margin-right: 10px;">
                        <a  href="/about" style="font-size: 18px;color: black">新人必读</a>
                    </li>
                    <li th:if="${session.user!=null}" style="margin-right: 10px;">
                        <a  href="/webscort" style="font-size: 18px;color: black">在线交流</a>
                    </li>
                    <li th:if="${session.user!=null}"style="font-size: 18px;color: black" >
                        <a href="/publish">发布问题</a>
                    </li>
                    <li th:if="${session.user!=null}" style="font-size: 18px;color: black"><a href="/profile/replies">我的未读信息 <span class="badge" th:text="${session.noReadConut}"></span></a></li>


                    <li th:if="${session.user==null}" style="font-size: 18px;color: black">
                        <div class="dropdown" style="margin-top: 11px;">
                            <a style="font-size: 18px;color: black" href="#" id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                登录
                                <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu" aria-labelledby="dLabel">
                                <li th:if="${session.user==null}" >
                                    <a href="/loginRegist">
                                        <spans class="glyphicon glyphicon-envelope"aria-hidden="true" style="margin-left: 8px;margin-right: 5px;"></spans>
                                        普通登录
                                    </a>
                                </li>
                                <li th:if="${session.user==null}">
                                    <a th:href="@{https://github.com/login/oauth/authorize(client_id='c21434fb236d27372757',redirect_uri=${#httpServletRequest.getRequestURL()+'callbacks'},scope='user',state=1)}">
                                     <img src="/img/github.png" style="width: 30px;height: 27px;">
                                        Github授权登录
                                    </a>
                                    <!--                        <a href="https://github.com/login/oauth/authorize?client_id=2ab2e1078934decb1a73&redirect_uri=http://localhost:8087/callbacks&scope=user&state=1">登录-->
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </li>


                    <!--判断当前用户是否登录-->
                    <li class="dropdown" th:if="${session.user!=null}">
                        <a style="font-size: 18px;" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" >
                            <span th:text="${session.user.getName()}"></span>
                            <span class=" glyphicon glyphicon-chevron-down" aria-hidden="true"></span>
                            <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li  style="margin-top: 15px;font-size: 18px;">
                                <span class="glyphicon glyphicon-question-sign"aria-hidden="true">
                                   <a style="margin-left: 1px;color: black" href="/profile/quesions">我的问题</a></li>

                            </span>
                            <li style="margin-top: 15px;font-size: 18px;"><span class="glyphicon glyphicon-user"aria-hidden="true">
                                <a style="margin-left: 1px;color: black" href="/selfs">个人资料</a></span></li>
                            <li style="margin-top: 15px;font-size: 18px;"><span class="glyphicon glyphicon-log-in"aria-hidden="true">
                                <a style="margin-left: 1px;color: black" href="/logout">退出</a></span></li>

                        </ul>
                    </li>

                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>
</div>
</body>
</html>